package top.zlhy7.enums;

import lombok.Getter;
import lombok.RequiredArgsConstructor;

import java.util.Arrays;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;

/**
 * @author renyong
 * @date 2024/9/29 20:34
 * @description 工单类型
 */
@Getter
@RequiredArgsConstructor
public enum OrderTypeEnum {
    /*
    工单类型0交办1直接答复3无效工单
     */
    ASSIGN(0, "交办"),
    DIRECT_REPLY(1, "直接答复"),
    INVALID(3, "无效工单");

    /**
     * 编码
     */
    private final Integer code;
    /**
     * 描述
     */
    private final String description;

    public static Map<Integer, OrderTypeEnum> orderTypeEnumMap;

    static {
        orderTypeEnumMap = Arrays.stream(OrderTypeEnum.values())
                .collect(Collectors.toMap(OrderTypeEnum::getCode, Function.identity()));
    }
}
